#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int Diditsum(int x)
{
	if (x / 10 > 0)
		return (x % 10) + Diditsum(x / 10);
	else
		return x;
}
int main()
{
	int c, c2;
	scanf("%d", &c);
	c2 = Diditsum(c);
	printf("%d\n", c2);
	return 0;
}
